package p270jp;

import java.util.Objects;
import p243io.reactivex.exceptions.CompositeException;
import p244ip.Response;
import p418pd.RxJavaPlugins;
import p436q6.StringMerger;
import p593wc.AbstractC6902j;
import p593wc.AbstractC6903n;
import p671zc.Disposable;

/* renamed from: jp.e */
/* loaded from: classes2.dex */
public final class ResultObservable<T> extends AbstractC6902j<Result> {

    /* renamed from: a */
    public final AbstractC6902j<Response<T>> f18275a;

    /* compiled from: ResultObservable.java */
    /* renamed from: jp.e$a */
    /* loaded from: classes2.dex */
    public static class C3981a<R> implements AbstractC6903n<Response<R>> {

        /* renamed from: a */
        public final AbstractC6903n<? super Result> f18276a;

        public C3981a(AbstractC6903n<? super Result> nVar) {
            this.f18276a = nVar;
        }

        @Override // p593wc.AbstractC6903n
        /* renamed from: b */
        public void mo307b(Throwable th) {
            try {
                AbstractC6903n<? super Result> nVar = this.f18276a;
                Objects.requireNonNull(th, "error == null");
                nVar.mo305g(new Result(null, th));
                this.f18276a.onComplete();
            } catch (Throwable th2) {
                try {
                    this.f18276a.mo307b(th2);
                } catch (Throwable th3) {
                    StringMerger.m2841u(th3);
                    RxJavaPlugins.m3026b(new CompositeException(th2, th3));
                }
            }
        }

        @Override // p593wc.AbstractC6903n
        /* renamed from: c */
        public void mo306c(Disposable bVar) {
            this.f18276a.mo306c(bVar);
        }

        @Override // p593wc.AbstractC6903n
        /* renamed from: g */
        public void mo305g(Object obj) {
            Response zVar = (Response) obj;
            AbstractC6903n<? super Result> nVar = this.f18276a;
            Objects.requireNonNull(zVar, "response == null");
            nVar.mo305g(new Result(zVar, null));
        }

        @Override // p593wc.AbstractC6903n
        public void onComplete() {
            this.f18276a.onComplete();
        }
    }

    public ResultObservable(AbstractC6902j<Response<T>> jVar) {
        this.f18275a = jVar;
    }

    @Override // p593wc.AbstractC6902j
    /* renamed from: r */
    public void mo983r(AbstractC6903n<? super Result> nVar) {
        this.f18275a.mo979a(new C3981a(nVar));
    }
}
